<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{strip}</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="language.builtin.functions.html" title="Chapter 7. Built-in Functions">
<link rel="prev" href="language.function.setfilter.html" title="{setfilter}">
<link rel="next" href="language.function.while.html" title="{while}">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">{strip}</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="language.function.setfilter.html">Prev</a> </td>
<th width="60%" align="center">Chapter 7. Built-in Functions</th>
<td width="20%" align="right"> <a accesskey="n" href="language.function.while.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="{strip}">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="language.function.strip"></a>{strip}</h2></div></div></div>
<p>
  Many times web designers run into the issue where white space and
  carriage returns affect the output of the rendered HTML (browser
  "features"), so you must run all your tags together in the template
  to get the desired results. This usually ends up in unreadable or
  unmanageable templates.
 </p>
<p>
  Anything within <code class="varname">{strip}{/strip}</code> tags  are stripped of the
  extra spaces or carriage returns at the beginnings and ends of the
  lines before they are displayed. This way you can keep your
  templates readable, and not worry about extra white space causing
  problems.
 </p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
   <code class="varname">{strip}{/strip}</code> does not affect the contents of template variables,
   see the <a class="link" href="language.modifier.strip.html" title="strip">strip modifier</a> instead.
  </p>
</div>
<div class="example">
<a name="id381758"></a><p class="title"><b>Example 7.78. {strip} tags</b></p>
<div class="example-contents">
<pre class="programlisting">

{* the following will be all run into one line upon output *}
{strip}
&lt;table border='0'&gt;
 &lt;tr&gt;
  &lt;td&gt;
   &lt;a href="{$url}"&gt;
    &lt;font color="red"&gt;This is a test&lt;/font&gt;
   &lt;/a&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
{/strip}

  </pre>
<p>
   The above example will output:
  </p>
<pre class="screen">

&lt;table border='0'&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://. snipped...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

  </pre>
</div>
</div>
<br class="example-break"><p>
  Notice that in the above example, all the lines begin and end
  with HTML tags. Be aware that all the lines are run together.
  If you have plain text at the beginning or end of any line,
  they will be run together, and may not be desired results.
 </p>
<p>
 See also the
 <a class="link" href="language.modifier.strip.html" title="strip"><code class="varname">strip</code></a> modifier.
 </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="language.function.setfilter.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="language.builtin.functions.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="language.function.while.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">{setfilter} </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> {while}</td>
</tr>
</table>
</div>
</body>
</html>
